//
//  WQCellView.m
//  货运代码
//
//  Created by 刘胤辰 on 16/5/5.
//  Copyright © 2016年 温泉. All rights reserved.
//

#import "WQCellView.h"
#import "YCImageView.h"
#import "YCViewModel.h"
#import "NetWorkTool.h"
#import "FDMDataModel.h"

#define kMatchDoctors @"http://iosapi.itcast.cn/matchDoctors.json.php"
#define kAddDoctorUrl @"http://iosapi.itcast.cn/addDoctor.json.php"

@interface WQCellView()

@property (nonatomic, strong) YCImageView *headImage;

@property (nonatomic, strong) UILabel *nameLab;

@property (nonatomic, strong) UILabel *extrNameLab;

@property (nonatomic, strong) UILabel *hospitalLab;

@property (nonatomic, strong) UIButton *btn1;

@property (nonatomic, strong) UIButton *btn2;

@property (nonatomic, strong) UIButton *btn3;

@property (nonatomic, strong) YCImageView *rightView;

@property (nonatomic, strong)UILabel *percentLab;

@property (nonatomic, strong)NSArray *dataArray;

@end

@implementation WQCellView



-(instancetype)initWithFrame:(CGRect)frame{
    
    self=[super initWithFrame:frame];
    
    //加载网络数据
    [self reloadWebData];
    
    return self;
}

-(void)reloadWebData{
    
    NSString *urlString = kMatchDoctors;
    NSDictionary *paramDic = @{@"ci1_id":@1,
                               @"ci2_id":@3,
                               @"ci3_id":@3,
                               @"diagnosis_type":@0,
                               @"page_size":@15,
                               @"is_confirmed":@1,
                               @"user_id":@1000089,
                               @"page":@1,
                               @"has_diagnosis":@2
                               };
    [[NetWorkTool shareManager]POST_RequestWithUrlString:urlString parmas:paramDic successBloock:^(id responseObject) {
        
        NSArray *array=responseObject[@"data"];
        
        NSMutableArray *tempArray=[NSMutableArray array];
        [array enumerateObjectsUsingBlock:^(NSDictionary *  _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
            
            FDMDataModel *model=[FDMDataModel initwithDict:obj];
            [tempArray addObject:model];
        }];
        
        self.dataArray=tempArray;
        
    } failureBlock:^(NSError *error) {
        
    }];
}

@end
